package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_UserAgentRequestOrderRecord 用户代理商申请记录
 *
 */
public class TestData_TB_UserAgentRequestOrderRecord
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_UserAgentRequestOrderRecord saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_UserAgentRequestOrder userAgentRequestOrder
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_UserAgentRequestOrderRecord");
		return (TB_UserAgentRequestOrderRecord)repository.save(newMust(
				userAgentRequestOrder
			));
	}
	
	public static TB_UserAgentRequestOrderRecord newMust(
		bairui.international.model.domain.jpa.TB_UserAgentRequestOrder userAgentRequestOrder
	){
		return new TB_UserAgentRequestOrderRecord(new TB_UserAgentRequestOrderRecord.MustProperties() {
			/** 类型 */
			@Override public bairui.international.model.type.Type_StateRecord getType(){
				return bairui.international.model.type.Type_StateRecord.Flow;
			}
			/** 说明 */
			@Override public String getCommentate(){
				return Generator.generate(0, 255);
			}
			/** 用户代理商申请单 */
			@Override public bairui.international.model.domain.jpa.TB_UserAgentRequestOrder getUserAgentRequestOrder(){
				return userAgentRequestOrder;
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_UserAgentRequestOrderRecord saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_UserAgentRequestOrder userAgentRequestOrder
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_UserAgentRequestOrderRecord");
		return (TB_UserAgentRequestOrderRecord)repository.save(newAll(
				userAgentRequestOrder
			));
	}
	
	public static TB_UserAgentRequestOrderRecord newAll(
		bairui.international.model.domain.jpa.TB_UserAgentRequestOrder userAgentRequestOrder
	){
		return new TB_UserAgentRequestOrderRecord(
			new TB_UserAgentRequestOrderRecord.MustProperties() {
				/** 类型 */
				@Override public bairui.international.model.type.Type_StateRecord getType(){
					return bairui.international.model.type.Type_StateRecord.Flow;
				}
				/** 说明 */
				@Override public String getCommentate(){
					return Generator.generate(0, 255);
				}
				/** 用户代理商申请单 */
				@Override public bairui.international.model.domain.jpa.TB_UserAgentRequestOrder getUserAgentRequestOrder(){
					return userAgentRequestOrder;
				}
			},
			new TB_UserAgentRequestOrderRecord.OptionalSingleProperties() {
				/** 消息 */
				@Override public String getMessage(){
					return Generator.generate(0, 255);
				}
			}
		);
	}
	

}
